package com.weiyuwqj.server.mapper;

import com.weiyuwqj.api.model.SysPicture;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;
import java.util.Map;

/**
 * Created by Administrator on 2015/12/7.
 */
@Repository
public interface SysPictureMapper extends Mapper<SysPicture>{
    //分页显示
    List<SysPicture> getList(Map<String, Object> param);
    //获取编辑信息
    SysPicture getSingle(Integer id);
    //获取图片地址
    List<SysPicture> getPictureByItemId(Map map);

    void addArticlePic(SysPicture picture);

    void deleteByItemId(Map map);

    //根据type获取图片
    List<SysPicture> getMainPicture(Integer type);

    List<SysPicture> getPartnerPicture();

    /**
     * 查询项目图片
     * @param param
     * @return
     */
    List<Map> getListByItemPicture(Map<String, Object> param);

    void deleteById(Integer id);

    //修改
    Integer modifyPictureByItemId(SysPicture picture);

    //app活动中心图片
    List<SysPicture> getListByActivity();

    //根据id修改项目图片类型
    Integer modifyItemPictureTypeById(@Param("itemPictureType")Integer itemPictureType,@Param("id") Integer id);

    SysPicture getScreenPicture();

    /**
     * 根据不同类型获取图片
     *
     * @param itemId 项目ID
     * @param type 类型 2 项目资料 3 多重保障
     * @return 图片集合
     */
    List<SysPicture> getListByType(@Param("itemId")Integer itemId, @Param("type") Integer type);
}
